﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StarryEdge.Core.Comparer
{
    public class FileNameComparer : IComparer
    {
        /// <summary>
        /// 文件排序
        /// </summary>
        /// <param name="o1"></param>
        /// <param name="o2"></param>
        /// <returns></returns>
        public int Compare(object o1, object o2)
        {
            FileInfo fi1 = o1 as FileInfo;
            FileInfo fi2 = o2 as FileInfo;
            if (fi1.FullName.Contains("StarryEdge.Module.Parameter") && !fi2.FullName.Contains("StarryEdge.Module.Parameter"))
            {
                return 1;
            }
            if (!fi1.FullName.Contains("StarryEdge.Module.Parameter") && fi2.FullName.Contains("StarryEdge.Module.Parameter"))
            {
                return -1;
            }
            return 0;
        }
    }
}
